<?php

use yii\helpers\Html;
use yii\bootstrap\ActiveForm;
use kartik\file\FileInput;


/* @var $this yii\web\View */
/* @var $model app\modules\Admin\models\Photo */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="photo-form">


<?php $form = ActiveForm::begin([
		'options' => [],
		'layout' => 'horizontal',
		'fieldConfig' => [
			'template' => "{label}\n{beginWrapper}\n{input}\n{hint}\n{error}\n{endWrapper}",
			'horizontalCssClasses' => [
			'label' => 'col-sm-2',
			'wrapper' => 'col-sm-6',
			],
		],
	]); ?>


    <!-- ?= $form->field($model, 'url')->textInput(['maxlength' => true]) ? -->
    <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>


	<?= $form->field($model, 'url')->widget(FileInput::classname(), [
			'options' => [
			'accept' => 'image/*',
								],
								'pluginOptions' => [
								'initialPreview'=> empty($model->url) ? '' : $model->url,
								'initialPreviewAsData'=>true,
								'showUpload' => true
								]
								]); ?>


    <?= $form->field($model, 'status')->radioList([1=>'正常' , 2=>'禁用']) ?>

    <div class="form-group text-center">
        <?= Html::submitButton('保存', ['class' => 'btn btn-success']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
